Pro JavaScript Techniques by Ferguson Russ & Paxton John & Resig John
Author: Ferguson, Russ & Paxton, John & Resig, John , Date: September 22, 2015
, Views: 347
function mouseOutHandler( e ) {
this.style.border = '0px';
e.stopPropagation();
}
// Locate, and traverse, all the elements in the DOM
var all = document.getElementsByTagName( '*' );
for ( var i = 0; i < all.length; i++ ) {
// Watch for when the user moves the mouse over the element
// and add a red border around the element
all[i].addEventListener( 'mouseover', mouseOverHandler );
// Watch for when the user moves back out of the element
// and remove the border that we added
all[i].addEventListener( 'mouseout', mouseOutHandler );
Copyright Disclaimer:
This site does not store any files on its server. We only index and link
to content provided by other sites. Please contact the content providers
to delete copyright contents if any and email us, we'll remove relevant
links or contents immediately.